home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-03-04 | 2.5 KB | 75 lines | [TEXT/ToyS] |
- (*
- Jasik (20.Feb.99):
-
- The manifestation of the bug is random tromping of memory, and sometimes it corrupts the heap
- (this happens when an Application is launched). The problem is that some programmer did a Load
- Contents when he meant to do a Load Address. The fix is as follows:
-
- Make a copy of the system file, and open it in a resource editor. Open up the
- 'nlib', id = 11 resource (name = NQDResidentCursor )
-
- Either do a Find Hex for the pattern '0844' or goto offset $1968 in the resource.
-
- You should see: 83A0 0844 7FC9 03A6
-
- CHANGE IT TO: 3BA0 0844 7FC9 03A6
-
- Save the file, play the appropriate games to replace the fixed System file
- [for] the running System file, and re-boot.
- *)
-
- property kasRType : "nlib"
- property kasRNum : 11
- property kasOffset : hex convert source "1968" with integer return
- property kasSrc : "83A008447FC903A6"
- property kasDst : "3BA008447FC903A6"
- property kasHexOffset : kasOffset * 2 -- 2 hex characters for each data byte
- property kasHexBeg : (kasHexOffset + 1) -- Add 1 since substrings are off 1
- property kasHexEnd : (kasHexOffset + (length of kasDst))
-
-
- on run
- if option key down of (input state) then
- try
- set nlib to the resource in (choose file) of type kasRType numbered kasRNum
- on error errStr
- ShowError("The resource could not be loaded from the file you chose." & return & return & "(Error: " & errStr & ")")
- end try
- else
- try
- set nlib to the resource of type kasRType numbered kasRNum
- on error errStr
- ShowError("The Jasik 85 patch does not apply to the running system." & return & return & "(Error: " & errStr & ")")
- end try
- end if
-
- set nlibHex to encode nlib in hexadecimal
- set patchText to the text from character kasHexBeg to kasHexEnd of nlibHex
-
- if (patchText is kasSrc) then
- -- Insert our data
- set nlibHex to replace data in nlibHex starting after position kasHexOffset with contents of kasDst
- -- Compile it
- set nlib to encode nlibHex from hexadecimal as (class of nlib)
- -- Save it
- save resource nlib numbered kasRNum
- ShowNote("The patch has been applied to this System." & return & return & "Restart the machine to have it take effect.")
- else if (patchText is kasDst) then
- ShowNote("The patch has already been applied to this System.")
- else
- ShowError("The Jasik 85 patch does not apply to the running system." & return & return & "(Code: " & patchText & ")")
- end if
- end run
-
-
-
- on ShowNote(msg)
- display dialog msg with icon note buttons {"OK"} default button 1
- end ShowNote
-
-
-
- on ShowError(msg)
- display dialog msg with icon stop buttons {"Cancel"} default button 1
- end ShowError
-